TmultiScore::TmultiScore(QMainWindow* mw, QWidget* parent) : TsimpleScore(1, parent), m_mainWindow(mw), m_inMode(e_multi), m_scale(1.0), m_clickedOff(0), m_currentIndex(-1), m_useAinim(true), m_addNoteAnim(true), m_selectReadOnly(false), m_isDisabled(false) { setObjectName(QStringLiteral("m_mainScore")); setStyleSheet(QStringLiteral("TsimpleScore#m_mainScore { background: transparent }")); setContentsMargins(2, 2, 2, 2); if (!TscoreNote::touchEnabled()) setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); // it is off by default staff()->setZValue(11); // to be above next staves - TnoteControl requires it setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setMaximumWidth(QWIDGETSIZE_MAX); // revert what TsimpleScore 'broke' setAlignment(Qt::AlignCenter); if (qApp->applicationName() == QLatin1String("Scorek")) { addStaff(staff()); // TODO: main score does that - but TmultiScore is dependent on it then - try to move it here setNote(0, Tnote()); // To display fake empty note properly } }
ColorMapDialog::ColorMapDialog(QWidget *parent, Qt::WFlags fl) : QDialog(parent, fl), applyBtn(nullptr), closeBtn(nullptr), editor(nullptr), d_matrix(nullptr) { setObjectName("ColorMapDialog"); setWindowTitle(tr("MantidPlot") + " - " + tr("Custom Color Map")); editor = new ColorMapEditor(); applyBtn = new QPushButton(tr("&Apply")); connect(applyBtn, SIGNAL(clicked()), this, SLOT(apply())); closeBtn = new QPushButton(tr("&Close")); connect(closeBtn, SIGNAL(clicked()), this, SLOT(reject())); QHBoxLayout *hb = new QHBoxLayout(); hb->setSpacing(5); hb->addStretch(); hb->addWidget(applyBtn); hb->addWidget(closeBtn); hb->addStretch(); QVBoxLayout *vl = new QVBoxLayout(this); vl->setSpacing(0); vl->addWidget(editor); vl->addLayout(hb); setMaximumWidth(editor->width() + 20); }
DLineEdit::DLineEdit(QWidget *parent, const char *name) : QWidget(parent) { setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); setFocusPolicy(Qt::StrongFocus); setMaximumWidth(200); setObjectName(name); QHBoxLayout *hbox = new QHBoxLayout(this); hbox->addWidget(&_lineedit); hbox->addWidget(&_calbutton); hbox->setSpacing(1); hbox->setMargin(0); QPixmap pixmap(":/widgets/images/calendar_24.png"); _calbutton.setIconSize(QSize(24,24)); _calbutton.setIcon(QIcon(pixmap)); _calbutton.setFlat(true); _calbutton.setMaximumSize(pixmap.size()); _calbutton.setFocusPolicy(Qt::NoFocus); connect(&_calbutton, SIGNAL(clicked()), &_lineedit, SLOT(showCalendar())); connect(&_lineedit, SIGNAL(editingFinished()), &_lineedit, SLOT(parseDate())); connect(&_lineedit,SIGNAL(newDate(const QDate &)), this, SIGNAL(newDate(const QDate &))); setFocusProxy(&_lineedit); }
MyPushButton::MyPushButton(int index) : QPushButton(0) { _index = index; setCheckable(true); setMaximumWidth(30); connect(this, SIGNAL(toggled(bool)), this, SLOT(handleClick())); }
BookmarksToolbar::BookmarksToolbar(QupZilla* mainClass, QWidget* parent) : QWidget(parent) , p_QupZilla(mainClass) , m_bookmarksModel(mApp->bookmarksModel()) , m_historyModel(mApp->history()) , m_toolButtonStyle(Qt::ToolButtonTextBesideIcon) { setObjectName("bookmarksbar"); m_layout = new QHBoxLayout(); m_layout->setMargin(3); m_layout->setSpacing(0); setLayout(m_layout); setAcceptDrops(true); setContextMenuPolicy(Qt::CustomContextMenu); connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint))); connect(m_bookmarksModel, SIGNAL(bookmarkAdded(BookmarksModel::Bookmark)), this, SLOT(addBookmark(BookmarksModel::Bookmark))); connect(m_bookmarksModel, SIGNAL(bookmarkDeleted(BookmarksModel::Bookmark)), this, SLOT(removeBookmark(BookmarksModel::Bookmark))); connect(m_bookmarksModel, SIGNAL(bookmarkEdited(BookmarksModel::Bookmark,BookmarksModel::Bookmark)), this, SLOT(bookmarkEdited(BookmarksModel::Bookmark,BookmarksModel::Bookmark))); connect(m_bookmarksModel, SIGNAL(subfolderAdded(QString)), this, SLOT(subfolderAdded(QString))); connect(m_bookmarksModel, SIGNAL(folderDeleted(QString)), this, SLOT(folderDeleted(QString))); connect(m_bookmarksModel, SIGNAL(folderRenamed(QString,QString)), this, SLOT(folderRenamed(QString,QString))); connect(m_bookmarksModel, SIGNAL(folderParentChanged(QString,bool)), this, SLOT(changeFolderParent(QString,bool))); connect(m_bookmarksModel, SIGNAL(bookmarkParentChanged(QString,QByteArray,int,QUrl,QString,QString)), this, SLOT(changeBookmarkParent(QString,QByteArray,int,QUrl,QString,QString))); setMaximumWidth(p_QupZilla->width()); refreshBookmarks(); showOnlyIconsChanged(); }
void ImageThumbnailBar::setFlow(QListView::Flow flow) { setWrapping(false); ImageCategorizedView::setFlow(flow); ImageThumbnailDelegate* const del = static_cast<ImageThumbnailDelegate*>(delegate()); del->setFlow(flow); // Reset the minimum and maximum sizes. setMinimumSize(QSize(0, 0)); setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX)); // Adjust minimum and maximum width to thumbnail sizes. if (flow == TopToBottom) { int viewportFullWidgetOffset = size().width() - viewport()->size().width(); setMinimumWidth(del->minimumSize() + viewportFullWidgetOffset); setMaximumWidth(del->maximumSize() + viewportFullWidgetOffset); } else { int viewportFullWidgetOffset = size().height() - viewport()->size().height(); setMinimumHeight(del->minimumSize() + viewportFullWidgetOffset); setMaximumHeight(del->maximumSize() + viewportFullWidgetOffset); } setScrollBarPolicy(d->scrollPolicy); }
/*! \brief Constructor Configures scroll area settings and resets internal stares of widget. Gets the width of device. \param parent The parent of scroll area widget */ CalenDayContentScrollArea::CalenDayContentScrollArea(QGraphicsItem *parent) : HbScrollArea(parent), mPanDayDirection(ECalenPanNotSet), mIsMoving(false), mMoveDirection(ECalenScrollNoDayChange), mDisallowedDirection(ECalenScrollNoDayChange) { #ifdef CALENDAYVIEW_PANNING_ENABLED grabGesture(Qt::PanGesture); ungrabGesture(Qt::SwipeGesture); #else grabGesture(Qt::SwipeGesture); ungrabGesture(Qt::PanGesture); #endif // Get the width of content area and orientation of screen mContentWidth = CalenDayUtils::instance()->contentWidth(); mOrientation = CalenDayUtils::instance()->orientation(); // Fix the width of scroll area setMinimumWidth(mContentWidth); setMaximumWidth(mContentWidth); // Connect to main window's orientationChanged SIGNAL to handle orientation // switching connect(CalenDayUtils::instance()->mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationChanged(Qt::Orientation))); }
TupRuler::TupRuler(Qt::Orientation rulerType, QWidget *parent) : QWidget(parent), k(new Private) { k->currentTransformation = None; k->rulerType = rulerType; k->origin = 0.0; k->oldPos = 0.0; k->rulerZoom = 1.0; k->currentZoomFactor = 1; k->arrow = QPolygonF(3); if (rulerType == Qt::Horizontal) { setMaximumHeight(20); setMinimumHeight(20); k->arrow << QPointF(0.0, 0.0); k->arrow << QPointF(5.0, 5.0); k->arrow << QPointF(10.0, 0.0); k->arrow.translate(0, 14); } else { setMaximumWidth(20); setMinimumWidth(20); k->arrow << QPointF(0.0, 0.0); k->arrow << QPointF(5.0, 5.0); k->arrow << QPointF(0.0, 10.0); k->arrow.translate(14, 0); } QFont ruleFont(font().family(), 7); setFont(ruleFont); }
KisProgressWidget::KisProgressWidget(QWidget* parent) : QWidget(parent) { QHBoxLayout* layout = new QHBoxLayout(this); m_cancelButton = new EscapeButton(this); m_cancelButton->setIcon(koIcon("process-stop")); QSizePolicy sizePolicy = m_cancelButton->sizePolicy(); sizePolicy.setVerticalPolicy(QSizePolicy::Ignored); m_cancelButton->setSizePolicy(sizePolicy); connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(cancel())); m_progressBar = new KoProgressBar(this); connect(m_progressBar, SIGNAL(valueChanged(int)), SLOT(correctVisibility(int))); layout->addWidget(m_progressBar); layout->addWidget(m_cancelButton); layout->setContentsMargins(0, 0, 0, 0); m_progressBar->setVisible(false); m_cancelButton->setVisible(false); setMaximumWidth(225); setMinimumWidth(225); }
RDCardSelector::RDCardSelector(QWidget *parent) : QWidget(parent) { card_id=-1; yoffset=0; // // Fix the Window Size // setMinimumWidth(sizeHint().width()); setMaximumWidth(sizeHint().width()); setMinimumHeight(sizeHint().height()); setMaximumHeight(sizeHint().height()); yoffset=0; // // Title // card_title=new QLabel(this,"card_title"); card_title->setGeometry(0,0,geometry().width(),19); card_title->setFont(QFont("Helvetica",12,QFont::Bold)); card_title->setAlignment(AlignHCenter); card_title->hide(); // // Card // card_card_box=new QSpinBox(this,"card_card_box"); card_card_box->setGeometry(60,yoffset,50,19); card_card_box->setSpecialValueText("None"); card_card_box->setMinValue(-1); card_card_box->setMaxValue(RD_MAX_CARDS-1); card_card_box->setValue(-1); connect(card_card_box,SIGNAL(valueChanged(int)),this,SLOT(cardData(int))); card_card_label=new QLabel(card_card_box,tr("Card:"),this, "card_card_label"); card_card_label->setGeometry(0,yoffset+2,55,19); card_card_label->setAlignment(AlignRight|ShowPrefix); // // Port // card_port_box=new QSpinBox(this,"card_port_box"); card_port_box->setGeometry(60,yoffset+22,50,19); card_port_box->setSpecialValueText("None"); card_port_box->setMinValue(-1); card_port_box->setMaxValue(RD_MAX_PORTS-1); card_port_box->setValue(-1); connect(card_port_box,SIGNAL(valueChanged(int)),this,SLOT(portData(int))); card_port_label=new QLabel(card_port_box,tr("Port:"),this, "card_port_label"); card_port_label->setGeometry(0,yoffset+24,55,19); card_port_label->setAlignment(AlignRight|ShowPrefix); for(int i=0;i<RD_MAX_CARDS;i++) { card_max_ports[i] = 0; cardData(i); } card_port_box->setDisabled(true); }
void Wormsign::hideHW(){ if(showHideHW->isChecked()){ int height = 1000; int width = 1000; setMinimumHeight(height); setMaximumHeight(height); setMinimumWidth(width); setMaximumWidth(width); showHideHW->setText(QString("<< Hide Config")); }else{ int height = 1000; int width = 645; setMinimumHeight(height); setMaximumHeight(height); setMinimumWidth(width); setMaximumWidth(width); showHideHW->setText(QString(">> Show Config")); } };
//----------------------------------------------------------------------------- // //----------------------------------------------------------------------------- tCZoneSwitchWidget::tCZoneSwitchWidget( const int index, QWidget* pParent, bool enableZoomIcons ) : QWidget( pParent ) ,m_Index(index) ,m_EnableZoomIcons(enableZoomIcons) { setMaximumWidth(WIDTH); }
LayerButton::LayerButton(const QString &text, QWidget *parent) : QPushButton(text, parent) { setToggleButton(true); setOn(true); setMaximumWidth(LayerButton::btnSize()); setMaximumHeight(LayerButton::btnSize()); }
ProjectTree::ProjectTree(QWidget *parent) : QWidget(parent) { setMaximumWidth(250); m_mainLayout = new QHBoxLayout(this); setLayout(m_mainLayout); m_treeWidget = new QTreeWidget(this); m_treeWidget->setContextMenuPolicy(Qt::CustomContextMenu); m_treeWidget->setColumnCount(1); m_treeWidget->setHeaderLabel(tr("Название проекта")); m_sourcesLabel = new QTreeWidgetItem((QTreeWidget*)0, QStringList(QString(tr("Исходные файлы")))); m_sourcesLabel->setIcon(0, QIcon(":/icons/actions/edit-find.png")); m_treeWidget->insertTopLevelItem(0, m_sourcesLabel); m_headersLabel = new QTreeWidgetItem((QTreeWidget*)0, QStringList(QString(tr("Заголовочные файлы")))); m_headersLabel->setIcon(0, QIcon(":/icons/actions/document-new.png")); m_treeWidget->insertTopLevelItem(0, m_headersLabel); m_mainLayout->addWidget(m_treeWidget); m_deleteAction = new QAction(QIcon(":/icons/actions/edit-undo.png"), tr("Удалить из проекта"), this); QObject::connect(m_deleteAction, SIGNAL(triggered(bool)), this, SLOT(deleteItem())); QObject::connect(m_treeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(onItemClicked(QTreeWidgetItem*,int))); QObject::connect(m_treeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onCustomContextMenu(QPoint))); }
RackWidget::RackWidget(Context& ctx, QWidget *parent) : QDockWidget(parent), ui(new Ui::RackWidget), ctx(ctx) { ui->setupUi(this); // sizing setMinimumWidth(760+20); setMaximumWidth(760+20); // QVBoxLayout* lay0 = new QVBoxLayout(); // lay0->setSpacing(1); // lay0->setMargin(0); // ui->scrollArea->setLayout(lay0); QWidget* w = new QWidget(nullptr); lay = new QVBoxLayout(ui->scrollArea); lay->setSpacing(1); lay->setMargin(0); w->setLayout(lay); ui->scrollArea->setWidget(w); //QVBoxLayout* layScroll = new QVBoxLayout(ui->scrollArea); //layScroll->addWidget(w); ui->scrollArea->setStyleSheet("QScrollArea > QWidget {background-color: black;}"); }
void CChkResultDialog::update_scrollArea() { scrollArea->hide(); m_pMultipleChkResult->update_result(); if(m_pMultipleChkResult->width() > QApplication::desktop()->width()*2/3) { scrollArea->setMinimumWidth(QApplication::desktop()->width()*2/3); } else { scrollArea->setMinimumWidth(m_pMultipleChkResult->width() + 50); } scrollArea->setMinimumHeight(scrollArea->height()); if(comboBox->currentIndex() == 1) { display_filter(1); } scrollArea->show(); adjustSize(); setMaximumWidth(width()); setMaximumHeight(height()); }
void DownloadItem::parentResized(const QSize &size) { if (size.width() < 200) { return; } setMaximumWidth(size.width()); }
EdLevelResourceSound::EdLevelResourceSound (const FilePath &path) { EdLevelSoundThumbnail *item = new EdLevelSoundThumbnail(this); item->setSound(path); item->setMaximumWidth(128); item->setMinimumWidth(128); item->setMaximumHeight(128); item->setMinimumHeight(128); QLabel *title = new QLabel(this); title->setMaximumWidth(200); title->setMinimumWidth(200); title->setText(path.file_name().c_str()); QGridLayout *layout = new QGridLayout; layout->setContentsMargins(2,2,2,2); layout->setHorizontalSpacing(0); layout->setVerticalSpacing(0); layout->setColumnStretch(1,1); layout->addWidget(item,1,0); layout->addWidget(title,0,0); setLayout(layout); setMinimumHeight(15+2+128); setMinimumWidth(200); setMaximumWidth(200); }
dmsBox::dmsBox(QWidget *parent, bool dg) : KLineEdit(parent), EmptyFlag(true) { setMaxLength(14); setMaximumWidth(160); setDegType( dg ); connect( this, SIGNAL( textChanged( const QString & ) ), this, SLOT( slotTextChanged( const QString & ) ) ); }
void MainWindow::slotVCardReceived( QString jid, QString name ) { roster.value( jid )->name = name; QString temp = name + QString( "\n" ) + roster[ jid ]->statusMsg; roster.value( jid )->contactEntry->setText( temp ); setMaximumWidth( contactsList->width() + mainToolBar->width() + 15 ); repaint(); }
void TimelineGraphicsLayout::setWidth(int width) { m_rulerItem->setSizeHints(width); m_placeholder1->setMinimumWidth(width); m_placeholder2->setMinimumWidth(width); setPreferredWidth(width); setMaximumWidth(width); }
ZLQtApplicationWindow::LineEditParameter::LineEditParameter(QToolBar *toolbar, ZLQtApplicationWindow &window, const ZLToolbar::TextFieldItem &textFieldItem) : QLineEdit(toolbar), myWindow(window), myActionId(textFieldItem.actionId()) { setAlignment(Qt::AlignHCenter); setFocusPolicy(ClickFocus); setMaxLength(textFieldItem.maxWidth()); setMaximumWidth(textFieldItem.maxWidth() * 12 + 12); QToolTip::add(this, QString::fromUtf8(textFieldItem.tooltip().c_str())); myWindow.addVisualParameter(textFieldItem.parameterId(), this); }
DoubleEdit::DoubleEdit(QWidget* parent) : QLineEdit(parent) { QDoubleValidator* validator = new QDoubleValidator(-DBL_MAX, DBL_MAX, 3, this); setValidator(validator); setMaximumWidth(60); setValue(0.0); }
void ResourceDock::setupHTools() { auto htools = new QFrame(this); auto vlayout = new QVBoxLayout(htools); vlayout->setMargin(2); vlayout->setSpacing(0); auto hlayoutTitle = new QHBoxLayout(); auto title = new QLabel(htools); title->setText("Resource Explorer "); title->setStyleSheet("color: lightGray;"); hlayoutTitle->addWidget(title); auto sepBrush = QBrush(Qt::gray, Qt::BrushStyle::Dense6Pattern); QPalette sepPalette; sepPalette.setBrush(QPalette::Background, sepBrush); auto seprator = new QLabel(htools); seprator->setAutoFillBackground(true); seprator->setPalette(sepPalette); seprator->setMaximumHeight(10); hlayoutTitle->addWidget(seprator, 1, Qt::AlignBottom); auto btnClose = new QToolButton(htools); btnClose->setText("X"); btnClose->setStyleSheet("color: lightGray\n"); btnClose->setAutoRaise(true); btnClose->setMaximumWidth(16); btnClose->setMaximumHeight(16); hlayoutTitle->addWidget(btnClose); connect(btnClose, &QToolButton::clicked, this, &QDockWidget::hide); vlayout->addLayout(hlayoutTitle); vlayout->addSpacing(2); auto hlayoutTools = new QHBoxLayout(); hlayoutTools->setMargin(0); hlayoutTools->setSpacing(0); auto btnCollAll = new QToolButton(htools); btnCollAll->setIcon(QIcon(":/icons/col")); btnCollAll->setToolTip("Collapse All"); btnCollAll->setToolButtonStyle(Qt::ToolButtonIconOnly); connect(btnCollAll, &QToolButton::clicked, resTree, &QTreeWidget::collapseAll); hlayoutTools->addWidget(btnCollAll); hlayoutTools->addSpacing(5); auto ledit = new QLineEdit(htools); ledit->setPlaceholderText("Search"); ledit->addAction(QIcon(":/icons/search"), QLineEdit::ActionPosition::TrailingPosition); ledit->setStyleSheet("background-color: gray;"); connect(ledit, &QLineEdit::textChanged, this, &ResourceDock::searchAct); hlayoutTools->addWidget(ledit, 1); vlayout->addLayout(hlayoutTools); htools->setLayout(vlayout); setTitleBarWidget(htools); }
MainWidget::MainWidget(QWidget *parent,const char *name) :QWidget(parent,name) { unsigned schema=0; // // Fix the Window Size // setMinimumWidth(sizeHint().width()); setMaximumWidth(sizeHint().width()); setMinimumHeight(sizeHint().height()); setMaximumHeight(sizeHint().height()); // // Generate Fonts // QFont font("Helvetica",12,QFont::Normal); font.setPixelSize(12); // // Open Database // rd_config=new RDConfig(RD_CONF_FILE); rd_config->load(); QString err; test_db=RDInitDb(&schema,&err); if(!test_db) { QMessageBox::warning(this,"Can't Connect", err,0,1,1); exit(0); } // // Generate Button // QPushButton *button=new QPushButton(this,"generate_button"); button->setGeometry(10,10,sizeHint().width()-20,50); button->setText("Generate Test"); button->setFont(font); connect(button,SIGNAL(clicked()),this,SLOT(generateData())); // // Remove Button // button=new QPushButton(this,"remove_button"); button->setGeometry(10,70,sizeHint().width()-20,50); button->setText("Remove Test"); button->setFont(font); connect(button,SIGNAL(clicked()),this,SLOT(removeData())); // // Exit Button // button=new QPushButton(this,"cancel_button"); button->setGeometry(10,130,sizeHint().width()-20,50); button->setText("Exit"); button->setFont(font); connect(button,SIGNAL(clicked()),this,SLOT(cancelData())); }
ListReports::ListReports(bool today_only,bool active_only,int dow, QWidget *parent) : QDialog(parent,"",true) { list_today_only=today_only; list_active_only=active_only; list_dow=dow; // // Fix the Window Size // setMinimumWidth(sizeHint().width()); setMaximumWidth(sizeHint().width()); setMinimumHeight(sizeHint().height()); setMaximumHeight(sizeHint().height()); setCaption(tr("RDLibrary Reports")); // // Create Fonts // QFont font=QFont("Helvetica",12,QFont::Bold); font.setPixelSize(12); // // Reports List // list_reports_box=new QComboBox(this); list_reports_box->setGeometry(50,10,sizeHint().width()-60,19); list_reports_box->insertItem(tr("Event Report")); list_reports_box->insertItem(tr("Upload/Download Report")); QLabel *list_reports_label= new QLabel(list_reports_box,tr("Type:"),this); list_reports_label->setGeometry(10,10,35,19); list_reports_label->setFont(font); list_reports_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter|Qt::TextShowMnemonic); // // Generate Button // QPushButton *generate_button=new QPushButton(this); generate_button-> setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50); generate_button->setDefault(true); generate_button->setFont(font); generate_button->setText(tr("&Generate")); connect(generate_button,SIGNAL(clicked()),this,SLOT(generateData())); // // Close Button // QPushButton *close_button=new QPushButton(this); close_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60, 80,50); close_button->setFont(font); close_button->setText(tr("&Close")); connect(close_button,SIGNAL(clicked()),this,SLOT(closeData())); }
StatusbarProgressWidget::StatusbarProgressWidget( ProgressDialog* progressdialog, QWidget* parent, bool button ) : QFrame( parent ), m_currentitem( 0 ), m_progressdialog( progressdialog ), m_delaytimer( 0 ), m_busytimer( 0 ) { setObjectName ( "StatusbarProgressWidget" ); m_showbutton = button; int w = fontMetrics().width( " 999.9 kB/s 00:00:01 " ); m_box = new QHBoxLayout( this ); m_box->setMargin( 0 ); m_box->setSpacing( 0 ); m_button = new QPushButton( this ); m_button->setSizePolicy( QSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum ) ); m_button->setIcon( QIcon( *NMGImageManager::loadPixmap( "up.png" ) ) ); m_button->setToolTip( "Open Tests detailed progress dialog" ); m_button->setMaximumHeight( fontMetrics().height() ); m_box->addWidget( m_button ); m_stack = new QStackedWidget( this ); m_stack->setMaximumHeight( fontMetrics().height() ); m_box->addWidget( m_stack ); m_progressbar = new QProgressBar( this ); //Uncomment the following lines if you want to customize the Progress Bar's Style //m_progressbar->setStyleSheet( "QProgressBar { border: 5px solid grey; border-radius: 5px; text-align: center; }" ); //m_progressbar->setStyleSheet( "QProgressBar::chunk { background-color: #CD96CD; width: 10px; margin: 0.5px; }" ); m_progressbar->installEventFilter( this ); m_progressbar->setMinimumWidth( w ); m_stack->addWidget( m_progressbar ); m_label = new QLabel( QString::null, this ); m_label->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter ); m_label->installEventFilter( this ); m_label->setMinimumWidth( w ); m_stack->addWidget( m_label ); m_mode = None; setMode(); connect( m_button, SIGNAL( clicked() ), m_progressdialog, SLOT( slotToggleVisibility() ) ); connect( ProgressManager::self(), SIGNAL( progressItemAdded( ProgressItem * ) ), this, SLOT( slotProgressItemAdded( ProgressItem * ) ) ); connect( ProgressManager::self(), SIGNAL( progressItemCompleted( ProgressItem * ) ), this, SLOT( slotProgressItemCompleted( ProgressItem * ) ) ); connect( m_progressdialog, SIGNAL( visibilityChanged( bool ) ), this, SLOT( slotProgressDialogVisible( bool ) ) ); m_delaytimer = new QTimer( this ); connect( m_delaytimer, SIGNAL( timeout() ), this, SLOT( slotShowItemDelayed() ) ); setMinimumWidth( minimumSizeHint().width() ); setMaximumWidth(m_progressbar->width () + m_button->width ()); }
void ReRulerWidget::SetRulerHeight( int _height ) { if( _height > 0 ) { m_rulerHeight = _height; IsHorizontal() ? setMaximumHeight( m_rulerHeight ) : setMaximumWidth( m_rulerHeight ); } }
AddEncoder::AddEncoder(QString *encname,const QString &stationname, QWidget *parent,const char *name) : QDialog(parent,name,true) { encoder_name=encname; encoder_stationname=stationname; // // Fix the Window Size // setMinimumWidth(sizeHint().width()); setMaximumWidth(sizeHint().width()); setMinimumHeight(sizeHint().height()); setMaximumHeight(sizeHint().height()); setCaption(tr("Add Encoder")); // // Create Fonts // QFont font=QFont("Helvetica",12,QFont::Bold); font.setPixelSize(12); QFont user_font=QFont("Helvetica",12,QFont::Normal); user_font.setPixelSize(12); // // Encoder Name // encoder_name_edit=new QLineEdit(this,"encoder_name_edit"); encoder_name_edit->setGeometry(145,11,sizeHint().width()-150,19); encoder_name_edit->setMaxLength(32); QLabel *label=new QLabel(encoder_name_edit,tr("&New Encoder Name:"), this,"encoder_name_label"); label->setGeometry(10,11,130,19); label->setFont(font); label->setAlignment(AlignRight|AlignVCenter|ShowPrefix); // // Ok Button // QPushButton *ok_button=new QPushButton(this,"ok_button"); ok_button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50); ok_button->setDefault(true); ok_button->setFont(font); ok_button->setText(tr("&OK")); connect(ok_button,SIGNAL(clicked()),this,SLOT(okData())); // // Cancel Button // QPushButton *cancel_button=new QPushButton(this,"cancel_button"); cancel_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60, 80,50); cancel_button->setFont(font); cancel_button->setText(tr("&Cancel")); connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData())); }
SndProperties::SndProperties(QString *title,QWidget *parent,const char *name) : QDialog(parent,name,true) { snd_title=title; setCaption("Array Properties"); // // Fix the Window Size // setMinimumWidth(sizeHint().width()); setMaximumWidth(sizeHint().width()); setMinimumHeight(sizeHint().height()); setMaximumHeight(sizeHint().height()); // // Create Fonts // QFont font=QFont("Helvetica",12,QFont::Normal); font.setPixelSize(12); QFont button_font=QFont("Helvetica",12,QFont::Bold); button_font.setPixelSize(12); // // Array Title // snd_title_edit=new QLineEdit(this,"snd_title_edit"); snd_title_edit->setGeometry(55,10,200,20); snd_title_edit->setText(QString(*snd_title)); QLabel *label=new QLabel(snd_title_edit,"&Title:", this,"snd_title_label"); label->setGeometry(10,10,40,20); label->setFont(font); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); // // OK Button // QPushButton *button=new QPushButton("&OK",this,"ok_button"); button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50); button->setDefault(true); button->setFont(button_font); connect(button,SIGNAL(clicked()),this,SLOT(okData())); // // Cancel Button // button=new QPushButton("&Cancel",this,"cancel_button"); button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,80,50); button->setFont(button_font); connect(button,SIGNAL(clicked()),this,SLOT(cancelData())); // // Populate Data // snd_title_edit->setText(*snd_title); }