void Edit::Image_mod_Setting()
{
/* QTextImageFormat nowimage; */
if (nowimage.isValid()) {
Edit_Image::self( this )->SetFormat(nowimage);
Edit_Image::self( this )->exec();
if (newforminepic.isValid()) {
nowimage = newforminepic;
qDebug() << "### Draw image h ... " << nowimage.height();
qDebug() << "### Draw image w... " << nowimage.width();
}
}
}
void Edit
::RContext( const QPoint & pos
) {
////////////////qDebug() << "### contextMenuEvent " << pos;
Eframe = false;
Eimage = false;
Etable = false;
Eframe = findercursor.currentFrame();
nowimage = findercursor.charFormat().toImageFormat();
nowtable = findercursor.currentTable();
Eimage = nowimage.isValid();
Etable = findercursor.currentTable();
qDebug() << "### Eframe " << Eframe;
qDebug() << "### Eimage " << Eimage;
qDebug() << "### Etable " << Etable;
TContext
= new QMenu(this);
if (editrun) {
TContext->addAction(tr( "View Modus" ), this , SLOT( ShowModusPanelView() ) );
TtableContext
= new QMenu(tr
("Table edit or new "),TContext
);
TtableContext->addAction(tr( "Insert Table here" ), this , SLOT( CreateanewTable() ) );
if (findercursor.currentTable()) {
TtableContext->addAction(tr( "Table (this) Propriety BackgroundColor, Padding, Spacing" ), this , SLOT( TableSetting() ) );
TtableContext->addAction(tr( "Merge selected cell (if select)" ), this , SLOT( MergeCellByCursorPosition() ) );
TtableContext->addAction(tr( "Append Row on this table" ), this , SLOT( AppendTableRows() ) );
TtableContext->addAction(tr( "Append Cools on this table" ), this , SLOT( AppendTableCools() ) );
TtableContext->addAction(tr( "Remove this row" ), this , SLOT( RemoveRowByCursorPosition() ) );
TtableContext->addAction(tr( "Remove this cool" ), this , SLOT( RemoveCoolByCursorPosition() ) );
}
TContext->addAction(TtableContext->menuAction());
TimageContext
= new QMenu(tr
("Image edit or new "),TContext
);
TimageContext->addAction(tr( "Insert new image" ), this , SLOT( CreateanewImage() ) );
if (Eimage) {
TimageContext->addAction(tr( "Image edit \"%1\" width - height" ).arg(locinfo.fileName()), this , SLOT( Image_mod_Setting() ) );
}
TContext->addAction(TimageContext->menuAction());
} else {
TContext->addAction(tr( "Edit Modus" ), this , SLOT( ShowModusPanelEdit() ) );
}
/* ..cute past & source view ecc........ */
void Edit::Image_mod_Setting()
{
/* QTextImageFormat nowimage; */
if (nowimage.isValid()) {
Edit_Image::self( this )->SetFormat(nowimage);
Edit_Image::self( this )->exec();
QTextImageFormat newforminepic = Edit_Image::self( this )->GetFormat();
if (newforminepic.isValid()) {
nowimage = newforminepic;
qDebug() << "### Draw image h ... " << nowimage.height();
qDebug() << "### Draw image w... " << nowimage.width();
}
}
}
void Edit::RContext( const QPoint & pos )
{
////////////////qDebug() << "### contextMenuEvent " << pos;
Eframe = false;
Eimage = false;
Etable = false;
QTextCursor findercursor(wtext->textCursor());
Eframe = findercursor.currentFrame();
nowimage = findercursor.charFormat().toImageFormat();
nowtable = findercursor.currentTable();
Eimage = nowimage.isValid();
Etable = findercursor.currentTable();
qDebug() << "### Eframe " << Eframe;
qDebug() << "### Eimage " << Eimage;
qDebug() << "### Etable " << Etable;
TContext = new QMenu(this);
if (editrun) {
TContext->addAction(tr( "View Modus" ), this , SLOT( ShowModusPanelView() ) );
TtableContext = new QMenu(tr("Table edit or new "),TContext);
TtableContext->addAction(tr( "Insert Table here" ), this , SLOT( CreateanewTable() ) );
if (findercursor.currentTable()) {
TtableContext->addAction(tr( "Table (this) Propriety BackgroundColor, Padding, Spacing" ), this , SLOT( TableSetting() ) );
TtableContext->addAction(tr( "Merge selected cell (if select)" ), this , SLOT( MergeCellByCursorPosition() ) );
TtableContext->addAction(tr( "Append Row on this table" ), this , SLOT( AppendTableRows() ) );
TtableContext->addAction(tr( "Append Cools on this table" ), this , SLOT( AppendTableCools() ) );
TtableContext->addAction(tr( "Remove this row" ), this , SLOT( RemoveRowByCursorPosition() ) );
TtableContext->addAction(tr( "Remove this cool" ), this , SLOT( RemoveCoolByCursorPosition() ) );
}
TContext->addAction(TtableContext->menuAction());
TimageContext = new QMenu(tr("Image edit or new "),TContext);
TimageContext->addAction(tr( "Insert new image" ), this , SLOT( CreateanewImage() ) );
if (Eimage) {
QString picname = nowimage.name();
QFileInfo locinfo(picname);
TimageContext->addAction(tr( "Image edit \"%1\" width - height" ).arg(locinfo.fileName()), this , SLOT( Image_mod_Setting() ) );
}
TContext->addAction(TimageContext->menuAction());
} else {
TContext->addAction(tr( "Edit Modus" ), this , SLOT( ShowModusPanelEdit() ) );
}
/* ..cute past & source view ecc........ */
To copy to clipboard, switch view to plain text mode
Bookmarks